<%@ include file="/WEB-INF/jsp/includes/include.jsp"%>

<!DOCTYPE html>
<html>
<head>
	<meta http-equiv="content-type" content="text/html; charset=utf-8" />
	<title>NoAssertions.com</title>
	<link rel="stylesheet" href="<fmt:message bundle="${mess}" key="baseUrl" />css/reset.css" />
	<link rel="stylesheet" href="<fmt:message bundle="${mess}" key="baseUrl" />css/text.css" />
	<link rel="stylesheet" href="<fmt:message bundle="${mess}" key="baseUrl" />css/960.css" />
	<link rel="stylesheet" href="<fmt:message bundle="${mess}" key="baseUrl" />css/nastyle.css" />
	<link rel="stylesheet" href="<fmt:message bundle="${mess}" key="baseUrl" />css/jquery.bulkupload.css" />
	<link rel="stylesheet" href="<fmt:message bundle="${mess}" key="baseUrl" />css/validationEngine.jquery.css" type="text/css" media="screen" charset="utf-8" />
	
	<script type="text/javascript" src="<fmt:message bundle="${mess}" key="baseUrl" />scripts/jquery.js"></script>
	<script type="text/javascript" src="<fmt:message bundle="${mess}" key="baseUrl" />scripts/jquery.validationEngine-en.js"></script>
	<script type="text/javascript" src="<fmt:message bundle="${mess}" key="baseUrl" />scripts/jquery.validationEngine.js"></script>
	<script type="text/javascript" src="<fmt:message bundle="${mess}" key="baseUrl" />scripts/jquery.bulkupload.js"></script>

	<script type="text/javascript">
	   jQuery('document').ready(
	      function(){
	 		 $("#fitForm").validationEngine();
	         jQuery(".bulkupload").bulkupload();
	      }
	   );
	</script>
	
</head>

<%@ include file="/WEB-INF/jsp/includes/bodyheader.jsp"%>
		<!--  start center section -->
		<div id="centerSection" class="grid_12">	
			<div class="grid_2 alpha">
				<%@ include file="/WEB-INF/jsp/includes/usermenu.jsp"%>
			</div>
			<div class="grid_8">
						
				<c:choose>
					<c:when test="${not empty noRiderDataError}">
						<p>It appears as if you haven't added your body measurements to your profile yet. Please <b><a href="<fmt:message bundle="${mess}" key="servletUrl" />rider/new">complete your rider profile</a></b> before contributing a fit</p> 
					</c:when>
					<c:otherwise>
					<h2>Submit Fit</h2>
					<c:if test="${not empty validationErrors}"> <p class="error">It appears as if something went wrong: ${validationErrors}</p></c:if>				
					<p>This form allows you to record your current fit numbers, the equipment you used to achieve this fit, and images of you on your bike. If you need help taking measurements, be sure to refer to the <b><a href="<fmt:message bundle="${mess}" key="servletUrl" />measure">How To Measure guide.</a></b></p> 
						<form id="fitForm"  action="<fmt:message bundle="${mess}" key="servletUrl" />fit" enctype="multipart/form-data" method="post">
							<div class="label">Date of Measurement: (yyyy-MM-dd)</div>
							<div class="input">
								<input id="dateofmeasurement" class="validate[required,custom[date]]" type="text" name="dateofmeasurement" value="${dateofmeasurement}"/>
							</div>
							<div class="label">Saddle Height:</div>
							<div class="input">
			    				<input id="saddleheight" class="validate[required,custom[onlyDouble]]" type="text" name="saddleheight" value="${saddleheight}" />
							</div>
							<div class="label">Hood Width:</div>
							<div class="input">
			    				<input id="barswidth" class="validate[required,custom[onlyDouble]]" type="text" name="barswidth"  value="${barswidth}"/>
							</div>	
							<div class="label">Floor to Bars:</div>
							<div class="input">
			    				<input id="floortobars" class="validate[required,custom[onlyDouble]]" type="text" name="floortobars" value="${floortobars}"/>
							</div>					
							<div class="label">Floor to Saddle:</div>
							<div class="input">
			    				<input id="floortosaddle" class="validate[required,custom[onlyDouble]]" type="text" name="floortosaddle" value="${floortosaddle}"/>
							</div>
							<div class="label">Center to Bars:</div>
							<div class="input">
			    				<input id="centertobars" class="validate[required,custom[onlyDouble]]" type="text" name="centertobars" value="${centertobars}" />
							</div>
							<div class="label">Center to Saddle:</div>
							<div class="input">
			    				<input id="centertosaddle" class="validate[required,custom[onlyDouble]]" type="text" name="centertosaddle" value="${centertosaddle}" />
							</div>
							<div class="label">Notes: (This is the place to record likes/dislikes about your fit.)</div>
							<div class="input">
			    				<textarea id="notes" class="validate[length[0,250]]" name="notes" rows="5" cols="50" >${notes}</textarea>
							</div>				
							<div class="label">Frame: (Brand, year, size, etc.)</div>
							<div class="input">
			    				<textarea id="frame" class="validate[length[1,250]]" name="frame" rows="2" cols="50">${frame}</textarea>
							</div>
							<div class="label">Shifters: (Brand, year, group, etc.)</div>
							<div class="input">
			    				<textarea id="shifters" class="validate[length[1,250]]" name="shifters" rows="2" cols="50">${shifters}</textarea>
							</div>
							<div class="label">Saddle: (Brand, year, width, etc.)</div>
							<div class="input">
			    				<textarea id="saddle" class="validate[length[1,250]]" name="saddle" rows="2" cols="50">${saddle}</textarea>
							</div>	
							<div class="label">Pedals: (Brand, year, etc.)</div>
							<div class="input">
			    				<textarea id="pedals" class="validate[length[1,250]]" name="pedals" rows="2" cols="50">${pedals}</textarea>
							</div>					
							<div class="label">Stem: (Brand, year, length, rise, etc.)</div>
							<div class="input">
			    				<textarea id="stem" class="validate[length[1,250]]" name="stem" rows="2" cols="50">${stem}</textarea>
							</div>
							<div class="label">Bars: (Brand, year, width, etc.)</div>
							<div class="input">
			    				<textarea id="bars" class="validate[length[1,250]]" name="bars" rows="2" cols="50">${bars}</textarea>
							</div>
							<div class="label">Seat Post: (Brand, year, offset, etc.)</div>
							<div class="input">
			    				<textarea id="post" class="validate[length[1,250]]" name="post" rows="2" cols="50">${post}</textarea>
							</div>
							<div class="label">Cranks: (Brand, year, length, etc.)</div>
							<div class="input">
			    				<textarea id="cranks" class="validate[length[1,250]]" name="cranks" rows="2" cols="50">${cranks}</textarea>
							</div>	
							
							<div class="label">Upload up to five images of your fit. Currently, only the jpg image format is supported. All files must be less than one megabyte (1MB) in size:</div>
							<div id="fileuploadcontainer"> 
								<div id="FileUploaderHolderHook"> 
									<input type="file" class="bulkupload" name="File[]" /> 
								</div>
							</div>
							<div class="submit">
								<input type="submit" class="inputSubmit" value="Submit" />
							</div>
						</form>
					</c:otherwise>
				</c:choose>
			</div>
				
			<div class="grid_2 omega">
			</div>
		</div>
		<div class="clear"></div>
		<!--  end center section -->
<%@ include file="/WEB-INF/jsp/includes/footer.jsp"%>		